
 
 F u n c t i o n :   e x t r a c t N o d e s ( d o m E l e m e n t ,   b o o l O n l y R e t u r n N o d e ) 
 
 
 
 D e s c r i p t i o n :   E x t r a c t s   a l l   D O M   n o d e s   w i t h i n   a n   e l e m e n t   a n d   r e t u r n s   t h e m   a s   a   D O M   f r a g m e n t   o r   e l e m e n t   n o d e . 
 
 
 
 R e t u r n s :   d o m F r a g m e n t ,   d o m E l e m e n t ,   o r   $ A   o b j e c t   i f   c h a i n e d . 
 
 
 
 N o t e :   T h e   e x t r a c t N o d e s ( )   f u n c t i o n   w i l l   r e t u r n   a   d o c u m e n t   f r a g m e n t   b y   d e f a u l t ,   w h i c h   m a y   i n c l u d e   m u l t i p l e   e l e m e n t s   a t   t h e   s a m e   l o g i c a l   l e v e l .   H o w e v e r ,   w h e n   b o o l O n l y R e t u r n N o d e   i s   s e t   t o   t r u e ,   a   s t a n d a r d   D O M   n o d e   w i l l   b e   r e t u r n e d   i n s t e a d .   W h e n   t h i s   o c c u r s ,   o n l y   t h e   f i r s t   t o p   l e v e l   c o n t a i n e r   e l e m e n t   i s   r e t u r n e d ,   a n d   a l l   o t h e r s   a t   t h e   s a m e   l o g i c a l   l e v e l   a r e   i g n o r e d .   T h e   r e t u r n e d   D O M   n o d e   m a y   c o n t a i n   a n y   n u m b e r   o f   a d d i t i o n a l   e l e m e n t s   t h o u g h ,   w i t h   n o   r e s t r i c t i o n .   U n l i k e   t h e   e m p t y ( )   a n d   r e m o v e ( )   f u n c t i o n s ,   e x t r a c t N o d e s ( )   w i l l   n o t   r e m o v e   a n y   a t t a c h e d   e v e n t s   o r   a s s o c i a t e d   d a t a   b i n d i n g s . 
 
 
 
 E x a m p l e : 
 
 
 
 / /   E x t r a c t   t h e   c o n t e n t s   o f   a   D O M   e l e m e n t   a n d   r e t u r n   a   d o c u m e n t   f r a g m e n t 
 
 v a r   m y N o d e s   =   $ A . e x t r a c t N o d e s ( d o m E l e m e n t ) ; 
 
 
 
 / /   E x t r a c t   t h e   c o n t e n t s   o f   a   D O M   e l e m e n t   a n d   r e t u r n   a   D O M   e l e m e n t   n o d e 
 
 v a r   m y N o d e   =   $ A . e x t r a c t N o d e s ( d o m E l e m e n t ,   t r u e ) ; 
 
 
 
 / /   O r   t h e   s a m e   u s i n g   c h a i n i n g 
 
 
 
 / /   E x t r a c t   t h e   c o n t e n t s   o f   a   D O M   e l e m e n t   a n d   r e t u r n   a   d o c u m e n t   f r a g m e n t 
 
 v a r   m y C h a i n   =   $ A ( d o m E l e m e n t ) . e x t r a c t N o d e s ( ) ; 
 
 
 
 / /   E x t r a c t   t h e   c o n t e n t s   o f   a   D O M   e l e m e n t   a n d   r e t u r n   a   D O M   e l e m e n t   n o d e 
 
 v a r   m y C h a i n   =   $ A ( d o m E l e m e n t ) . e x t r a c t N o d e s ( t r u e ) ; 
 
 
 
 / /   T o   r e t u r n   t h e   m o d i f i e d   e l e m e n t   w i t h i n   a   c h a i n ,   u s e   t h e   " r e t u r n ( ) "   m e t h o d . 
 
 
 
 v a r   m y E l e m e n t   =   m y C h a i n . r e t u r n ( ) ; 
 
 